<div class="bg-light lter b-b wrapper-sm">
    <h1 class="m-n font-thin h4">应收账单管理</h1>
</div>
<div class="wrapper-sm" ng-controller="receivableBillController">
    <div class="panel panel-default">
        <div class="panel-heading font-bold">查询</div>
        <div class="panel-body">
            <label class="control-label pull-left m-t-xs w-xs">应收总编号</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm"  ng-model="queryTerms.receivableBillId" id="table_receivableBillManagent_receivableBillId" placeholder="请输入应收总编号" name="code">
            </div>
            <label class="control-label pull-left m-t-xs w-xs">结算人</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm"  ng-model="queryTerms.reckoner" id="table_receivableBillManagent_reckoner" placeholder="请输入结算人" name="reckoner">
            </div>
            <label class="control-label pull-left m-t-xs w-xs">结算单位</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm"  ng-model="queryTerms.settle" id="table_receivableBillManagent_settle" placeholder="请输入结算单位" name="settle">
            </div>
            <label class="control-label pull-left m-t-xs w-xs">应收总额</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm"  ng-model="queryTerms.receivableTotalPrice" id="table_receivableBillManagent_receivableTotalPrice" placeholder="请输入应收总额" name="totalmoney">
            </div>
            <div class="line line-xs pull-in"></div>
            <label class="control-label pull-left m-t-xs w-xs">结算起始时间</label>
            <div class="col-md-2 col-xs-12 form-group">
                <div class="input-group input-group-sm date">
                    <input datetimepicker plugintype="datetime" ng-model="queryTerms.deliveryTime" id="starttime" placeholder="结算起始时间" class="form-control" type="text" name="deliveryTime" />
                    <span id="openstarttime" class="input-group-addon curpoint">
                        <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
            <label class="control-label pull-left m-t-xs w-xs">结算结束时间</label>
            <div class="col-md-2 col-xs-12 form-group">
                <div class="input-group input-group-sm date">
                    <input datetimepicker plugintype="datetime" ng-model="queryTerms.endTime" id="endtime" placeholder="结算结束时间" class="form-control" type="text" name="endTime" />
                    <span id="openendtime" class="input-group-addon curpoint">
                        <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
            <label class="control-label pull-left m-t-xs w-xs">客户单位</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" ng-model="queryTerms.clientName" id="table_receivableBillManagent_clientName" placeholder="请输入客户单位" name="totalmoney">
            </div>
            <label class="control-label pull-left m-t-xs w-xs">开票状态</label>
            <div class="col-md-2 form-group">
                <select class="form-control input-sm" ng-model="queryTerms.invoiceStatus" id="table_receivableBillManagent_invoiceStatus" name="invoiceStatus" ng-options="x.value as x.text for x in invoiceStatusDropDown"> 
                    <option value="">全部</option>
                </select>
            </div>
            <label class="control-label pull-left w-xs"></label>
            <div class="col-md-2 col-xs-12 pull-right form-group">
                <button id="table_receivableBillManagent_search" ng-click="queryFunc()" id="table_receivableBillManagent_query" class="btn btn-sm btn-default btn-addon" ng-class="{'disabled':querying}" ng-disabled="querying">
                        <i class="fa fa-search" ng-show="!querying"></i>
                        <i class="fa fa-spinner no-bordr" ng-show="querying" ng-class="{'fa-spin':querying}"></i>
                        <span ng-show="!querying">查询</span>
                        <span ng-show="querying">查询中...</span>
                    </button>
            </div>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            应收账单列表
        </div>
        <div class="table-responsive">
            <div ui-grid="gridOptions" id="table_receivableBillManagent_gridOptions" ui-grid-selection ui-grid-exporter ui-grid-pagination ui-grid-auto-resize ui-grid-resize-columns style="height:{{heightA}}px; min-width:1000px; min-height:395px; overflow-y:hidden;">
                <div class="watermark" ng-if="!gridOptions.data.length">暂无数据</div>
            </div>
        </div>
        <div class="panel-body">
            <div class="form-group">
                <button id="table_receivableBillManagent_income" ng-click="incomeDetail()" class="pull-right-xs btn btn-sm btn-success btn-addon " ng-show="receivableDis"><i class="fa fa-file-text"></i>收入明细</button>
                <button id="table_receivableBillManagent_add" data-toggle="modal" data-target="#orderAdd" ng-click="addBill()" class="pull-right-xs btn btn-sm btn-info btn-addon "><i class="fa fa-plus"></i>新增账单</button>
                <button id="table_receivableBillManagent_managent" ng-click="receivableBillAdd()" class="pull-right-xs btn btn-sm btn-primary btn-addon "><i class="fa fa-file-text-o"></i>账单管理</button>
                <button id="table_receivableBillManagent_export" ng-click="exportbilllist()" class="pull-right-xs btn btn-sm btn-success btn-addon " ng-if="exportbilllistShow"><i class="fa fa-file-text"></i>导出</button>
            </div>
        </div>
    </div>

    <!--orderChildren Modal -->
    <div class="modal fade bs-example-modal-lg" id="orderAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button id="table_receivableBillManagent_AddReceivableBill" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">新增账单</h4>
                </div>
                <form name="step1" id="formBill" class="form-validation form-horizontal" novalidate>
                    <div class="modal-body overflow0">
                        <!--<div class="form-group">
							<label class="col-lg-3 control-label">应收总编号</label>
							<label class="col-lg-4 control-label text-left">{{code}}</label>
						</div>-->
                        <div class="form-group">
                            <label class="col-lg-3 control-label">客户单位<span class="text-danger">*</span></label>
                            <div class="col-lg-5">
                                <div angucomplete-alt id="client" placeholder="" pause="100" selected-object="clientSelect" remote-api-handler="searchSelect" search-fields="name" title-field="name" minlength="1" input-class="form-control form-control-small" input-name="addParent.clientId"
                                    field-required="true" match-class="highlight">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">结算单位<span class="text-danger">*</span></label>
                            <div class="col-lg-3">
                                <div angucomplete-alt id="settleBox" placeholder="" pause="100" selected-object="settleBoxSelect" remote-api-handler="searchSettle" search-fields="name" title-field="name" minlength="1" input-class="form-control form-control-small" input-name="addParent.settleId"
                                    field-required="true" match-class="highlight">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">应收总额<span class="text-danger">*</span></label>
                            <div class="col-lg-3">
                                <input id="table_receivableBillManagent_totalMoneyBox" type="text" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" class="form-control " ng-model="addParent.totalMoney" placeholder="请填写应收总额" name="totalMoneyBox" required>
                            </div>
                            <label class="pull-left control-label">元</label>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">开票状态<span class="text-danger">*</span></label>
                            <div class="col-lg-3">
                                <select class="form-control" id="table_receivableBillManagent_invoiceStatus02" ng-model="addParent.invoiceStatus" name="carLength" ng-options="x.value as x.text for x in invoiceStatusDropDown" required>
                                    <option value="">请选择</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">开票日期</label>
                            <div class="col-lg-3">
                                <div class="input-group input-group-sm date">
                                    <input id="invoiceTime" datetimepicker plugintype="datetime" ng-model="addParent.invoiceTime" placeholder="开票日期" class="form-control" type="text" name="invoiceTime" />
                                    <span id="openinvoiceTime" class="input-group-addon curpoint">
                                        <span class="glyphicon glyphicon-calendar"></span>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">应收说明</label>
                            <div class="col-lg-5">
                                <textarea class="form-control" ng-model="addParent.description" placeholder="请填写应收说明" name="description"></textarea>
                            </div>
                        </div>
                    </div>
                </form>
                <div class="modal-footer">
                    <button id="table_receivableBillManagent_miss" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button id="table_receivableBillManagent_save" type="button" ng-disabled="isDisabled" class="btn btn-primary" ng-click="addParent.click()">保存</button>
                </div>
            </div>
        </div>
    </div>
</div>